package java学习.第17章_反射机制;

import java.beans.JavaBean;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.HashMap;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.TYPE;

// @Documented :表示所修饰的注解在javadoc解析时   保留下来（api）
@Deprecated
@JavaBean
@SuppressWarnings("846")
@Table(name = "写个表名做提示")
public class FS extends HashMap<String, Integer> implements Comparable<String> {
    @Column(columName = "名字", columType = "字段类型")
    private static String name;
    public static String staname;
    protected String namess;
    String names;
    public int age;

    static {
        System.out.println("666");
    }
    public FS() {
        System.out.println("空参方法");
    }

    private FS(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public FS(int age) {
        this.age = age;
        this.name = "默认名字";
    }

    private FS(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "FS{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }

    private void pr() {
        System.out.println("我是private的");
    }
    public void pu() {
        System.out.println("我是public的");
    }

    @Deprecated(since = "fq")//表示已废弃
    private static void show(int a) {
        System.out.println("我是静态的" + a);
    }

    private String show(String gj) {
        System.out.println("我的国籍是:" + gj);
        return gj;
    }

    public String getName() throws Exception {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public int compareTo(String o) {
        return 0;
    }
}
@Target({TYPE})
@Retention(RetentionPolicy.RUNTIME)
@interface Table{
    String name();
}

@Target({FIELD})
@Retention(RetentionPolicy.RUNTIME)
@interface Column{
    String columName();

    String columType();
}